/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gameheart.client.sprite;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

/**
 *
 * @author win7
 */
public class TextBoxSprite extends Sprite {
    private SynMessage _text;
    private Color _color;
    public TextBoxSprite(int x,int y, String text, int maxStringLength,  BufferedImage image, Color color)
    {
        _text = new SynMessage(maxStringLength, text);
        _color = color;
        Init(x, y, image);
        
    }
    public TextBoxSprite(int x,int y, String text, int maxStringLength,  BufferedImage image)
    {
        _text = new SynMessage(maxStringLength, text);
        _color = Color.black;
        Init(x, y, image);
        
    }
        public TextBoxSprite(int x,int y,int w, int h, String text, int maxStringLength,  BufferedImage image)
    {
        _text = new SynMessage(maxStringLength, text);
        _color = Color.black;
        Init(x, y,w, h, image);
        
    }
    @Override
    public void draw(Graphics g)
    {
       super.draw(g);
        Color color = g.getColor();
        g.setColor(_color);
        g.drawString(getText().getMessage(), _x + 20, _y + 20);
        g.setColor(color);
    }

    /**
     * @return the _text
     */
    public SynMessage getText() {
        return _text;
    }

    
}
